package com.zrong.gamesdk.test.unit;

import static org.easymock.EasyMock.*;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * 功能描述
 *
 * @author huzl
 * @version 0.0.1, 12-5-23 下午1:31
 */

public class MapTestCase {

    @SuppressWarnings("rawtypes")
	@Test
    public void testMap()throws Exception{
        Map map = createMock(Map.class);
        expect(map.get(anyObject())).andReturn("10").once();
        replay(map);
        System.out.println(map.get("1"));
    }

    @SuppressWarnings("rawtypes")
	@Test
    public void testHashMap()throws Exception{
        HashMap map = createMock(HashMap.class);
        expect(map.get("1")).andReturn("100").once();
        expect(map.get("2")).andReturn("200").once();
        replay(map);
        System.out.println(map.get("1"));
        System.out.println(map.get("2"));
    }

}
